﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WebManagerSystem1.Models
{
    public class Config
    {
        /// <summary>
        /// 本系统数据库连接
        /// </summary>
        public  BaseLibrary.CDataContext.ConnectionSetting.Conn Conn
        {
            get;
            private set;
        }
        /// <summary>
        /// 系统名称
        /// </summary>
        public  string Title { get; private set; }
        public Config()
        {
            BaseLibrary.Config.ConfigRW configRW = new BaseLibrary.Config.ConfigRW();
            Conn = configRW.ConnGet("conn");
            if (Conn == null || Conn.Provider== BaseLibrary.CDataContext.EProvider.None)
                Conn = new BaseLibrary.CDataContext.ConnectionSetting.Conn() { Provider = BaseLibrary.CDataContext.EProvider.SQLite, Connection = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DB.sq") };
            Title = configRW.ValueGet("Title");
            if (string.IsNullOrWhiteSpace(Title))
                Title = "我的系统";
        }
    }
}
